package file;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test05 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);


        while (true){
            System.out.println("输入想要创建的文件名：");
            String sInt = sc.next();
            File f = new File("./"+sInt);
            if (f.exists()){
                System.out.println("该文件存在，请重新输入");
            }else {
                f.createNewFile();
                System.out.println("文件创建成功");
                break;
            }
        }
    }
}
